#include <iostream>
#include <cstdlib>
#include <fstream>
#include <sqlite3.h>
#include <vector>
#include <sstream>
#include <cctype>
#include <string>
#include <cstring>
#include <iomanip>

using namespace std;
void press_enter();
const int WRONG_PASSWORD = 1;
const int ACCOUNT_LOCKED = 2;
const int WRONG_USERNAME = -1;
const int SUCCESS = 0;
const bool IS_EMPTY = false;
const bool FOUND = true;

class Database{
	public:
		Database();
		~Database();

		sqlite3* getSqlite3();

		void open(char* filename);

		int getFail();

		void close();

		vector<vector<string> > query(string );

		bool checkForUser(string);
		bool checkForStudent(string);
		bool checkForAdmin(string);
		bool checkForLecturer(string);

		int authenticate(string, string);
		void populate(string);
		void resetTries(string);
		void lockUser(string);
		int increaseTries(string);

		void changePassword(string);
		void unlockUser(string);

		bool checkLockedUser(string);
        bool checkForLessonsId(string );
		bool checkModuleCode(string);
		vector<vector<string> > returnPtId(string, string);
		bool checkForVenue(string);
		bool checkForTimeslot(string);
		
		vector<vector<string> > returnModuleOfLesson(string);
		vector<vector<string> > returnModuleFromLM(string );

		string getUsername();
		string getFullName();
		string getEmail();
		string getType();


	private:
		sqlite3 *db;
		int fail;
		string username;
		string type;
		string fullName;
		string email;
};


